package org.soft.carbon_neutral.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.soft.carbon_neutral.entity.EnergyConsumption;
import org.soft.carbon_neutral.mapper.EnergyConsumptionMapper;
import org.soft.carbon_neutral.service.EnergyConsumptionService;
import org.soft.carbon_neutral.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EnergyConsumptionServiceImpl extends ServiceImpl<EnergyConsumptionMapper,EnergyConsumption> implements EnergyConsumptionService {

    @Autowired
    private EnergyConsumptionMapper energyConsumptionMapper;

    public R getConsumptionList() {
        QueryWrapper<EnergyConsumption> wrapper= new QueryWrapper<>();
        List<EnergyConsumption> energyConsumptions = energyConsumptionMapper.selectList(wrapper);
        return R.success().data("energyConsumptionList",energyConsumptions);
    }
}
